#ifndef RTC_h
#define RTC_h

#include "stm32f10x.h"

#define Is_LeapYear(year)	(year%4==0&&year%100!=0)||year%400==0

typedef struct
{
	uint8_t RTC_Hours;
	uint8_t RTC_Minutes;
	uint8_t RTC_Seconds;
}RTC_TimeTypeDef; 


typedef struct
{
	uint8_t RTC_Month;
	uint8_t RTC_Date;
	uint16_t RTC_Year;
}RTC_DateTypeDef;


extern __IO uint32_t TimeDisplay;
extern __IO RTC_TimeTypeDef RTC_TimeStructure;
extern __IO RTC_DateTypeDef RTC_DateStructure;


void RTC_Configuration(void);
int RTC_SetDateTime(uint16_t year,uint8_t mon,uint8_t day,uint8_t hour,uint8_t min,uint8_t sec);
void Time_Display(uint32_t TimeVar);
uint8_t RTC_GetDateTime(void);
void RTC_TimeShow(void);
void RTC_DateShow(void);

#endif
